// Inverse colors shader

#if defined(VERTEX) ///////////////////////////////////////////////////

layout(location=0) in vec3 aPosition;
layout(location=2) in vec2 aTexCoord;

out vec2 vTexCoord;

void main() {

	vTexCoord = aTexCoord;
	gl_Position = vec4(aPosition.x, aPosition.yz, 1);
	
}

#elif defined(FRAGMENT) ///////////////////////////////////////////////

layout(location = 0) out vec4 inverseColor;

uniform sampler2D uTexture;

in vec2 vTexCoord;

void main(){

	vec4 textureColor = vec4(texture(uTexture, vec2(vTexCoord.x, 1.0f - vTexCoord.y)).rgba);
	inverseColor = vec4(1.0 - textureColor.x, 1.0 - textureColor.y, 1.0 - textureColor.z, textureColor.a);

}

#endif

